package day220;

import java.util.Scanner;

public class CalTotalAvg1 {

    public static void main(String[] args) {
        double total=total();
        System.out.println(total);
    }
    public static double total(){
        Scanner scan=new Scanner(System.in);
        double[] a=new double[6];
        for(int i=0;i<a.length;i++){
            System.out.println("请输入第"+(i+1)+"个评委的分数");
            a[i]=scan.nextDouble();
        }
        double total=0;
        double max=a[0];
        double min=a[0];
        for(int i=0;i<a.length;i++){
            if(a[i]>max){
                max=a[i];
            }
            if(a[i]<min){
                min=a[i];
            }
            total+=a[i];
        }
        return total-max-min;
    }
}
